package com.frank.framework.config;


import org.redisson.spring.starter.RedissonAutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * 排除启动加载自动配置
 * 如果配置项spring.redis.enabled的值为false时，则当前配置生效，即排除掉启动加载RedissonAutoConfiguration.class和RedisAutoConfiguration.class自动配置。
 * @author Frank
 */
//@Profile("!prod") // 也可以指定激活哪个环境是当前配置生效
@Configuration
@ConditionalOnProperty(value = "spring.redis.enabled", havingValue = "false")
@EnableAutoConfiguration(exclude = {RedissonAutoConfiguration.class, RedisAutoConfiguration.class})
public class ExcludeAutoConfiguration {
}
